function chainModify(dataId) {
	document.getElementById("dataId").value = dataId;
	document.forms["listForm"].submit();
}

function changeStart() {
	document.getElementById("year").value = document.getElementById("startYear").value;
	document.getElementById("month").value = document.getElementById("startMonth").value;
	document.getElementById("date").value = document.getElementById("startDate").value;
}

function setFocus() {
	document.getElementById("startDate").focus();
}

function dispYMD() {
	if (document.getElementById("startYear").value == "" && document.getElementById("startMonth").value == "" && document.getElementById("startDate").value == "") {
		document.getElementById("startYear").value = document.getElementById("year").value;
		document.getElementById("startMonth").value = document.getElementById("month").value;
		document.getElementById("startDate").value = document.getElementById("date").value;
		document.getElementById("endYear").value = document.getElementById("year").value;
		document.getElementById("endMonth").value = document.getElementById("month").value;
		document.getElementById("endDate").value = document.getElementById("date").value;
	}
}

function chainDelete(dataId) {
	document.getElementById("dataId").value = dataId;
	document.getElementById("password").value = window.prompt("データを削除します。よろしいですか。\nよろしければパスワードを入力してください。", "");
	if (document.getElementById("password").value == null || document.getElementById("password").value == "") {
		return false;
	}
	document.forms["listForm"].action = "/deleteData/";
	document.forms["listForm"].submit();
}

function chainModifyMsg(dataId) {
	document.getElementById("dataId").value = dataId;
	document.forms["listForm"].submit();
}

function chainDeleteMsg(dataId) {
	document.getElementById("dataId").value = dataId;
	document.getElementById("password").value = window.prompt("データを削除します。よろしいですか。\nよろしければパスワードを入力してください。", "");
	if (document.getElementById("password").value == null || document.getElementById("password").value == "") {
		return false;
	}
	document.forms["listForm"].action = '/message/delete';
	document.forms["listForm"].submit();
}